package com.zdp.algorithm.linkedlist;


/**
 * @author Zhengdp
 * @date 2023年01月31日 16:03
 */
public class Node {
    public int value;
    public Node next;

    public Node(int value){
        this.value = value;
        this.next = null;
    }

    public Node(){}

    public Node(int value,Node next) {
        this.value = value;
        this.next = next;
    }

    public static Node createNodeList(String[] arr){
        Node head = new Node();
        Node p = head;
        for(String item :arr) {
            Node tmp = new Node(Integer.valueOf(item));
            tmp.next = p.next;
            p.next = tmp;
            p = tmp;
        }
        return head;
    }
}
